load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "storage",
    srcs = ["task_table.go"],
    importpath = "github.com/pingcap/tidb/disttask/framework/storage",
    visibility = ["//visibility:public"],
    deps = [
        "//disttask/framework/proto",
        "//kv",
        "//parser/terror",
        "//sessionctx",
        "//util/chunk",
        "//util/logutil",
        "//util/sqlexec",
        "@com_github_ngaut_pools//:pools",
        "@com_github_pingcap_errors//:errors",
        "@com_github_pingcap_failpoint//:failpoint",
        "@com_github_tikv_client_go_v2//util",
        "@org_uber_go_zap//:zap",
    ],
)

go_test(
    name = "storage_test",
    timeout = "short",
    srcs = ["table_test.go"],
    flaky = True,
    race = "on",
    shard_count = 3,
    deps = [
        ":storage",
        "//disttask/framework/proto",
        "//testkit",
        "//testkit/testsetup",
        "@com_github_ngaut_pools//:pools",
        "@com_github_pingcap_errors//:errors",
        "@com_github_pingcap_failpoint//:failpoint",
        "@com_github_stretchr_testify//require",
        "@org_uber_go_goleak//:goleak",
    ],
)
